#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import time


def home():
    print("welcome home ")
    time.sleep(2)


def timer(func):
    def warpper():
        start = time.time()
        func()   # 将函数引用的内存地址执行
        end = time.time()
        print("装饰器执行的时长为: {}".format(end - start))
    return warpper  # 最终在返回其结果

home = timer(home)
home()
